6dofimu15 2.2.0
6dofimu15


6DOF IMU 15 Click

6DOF IMU 15 Click demo application is developed using the NECTO Studio, ensuring compatibility with mikroSDK's open-source libraries and tools. Designed for plug-and-play implementation and testing, the demo is fully compatible with all development, starter, and mikromedia boards featuring a mikroBUS™ socket.


Click Library

  • Author : MikroE Team
  • Date : Sep 2020.
  • Type : I2C/SPI type

Software Support

Example Description

This example demonstrates the use of 6DOF IMU 15 Click board.

Example Libraries

  • MikroSDK.Board
  • MikroSDK.Log
  • Click.6DofImu15

Example Key Functions

Application Init

Initializes the driver, checks the communication and sets the device default configuration.

void application_init ( void )
{
log_cfg_t log_cfg;
LOG_MAP_USB_UART( log_cfg );
log_init( &logger, &log_cfg );
log_info( &logger, "---- Application Init ----" );
// Click initialization.
C6DOFIMU15_MAP_MIKROBUS( cfg, MIKROBUS_1 );
c6dofimu15_init( &c6dofimu15, &cfg );
Delay_ms ( 100 );
if ( c6dofimu15_who_im_i( &c6dofimu15 ) )
{
log_printf( &logger, "---------------------- \r\n" );
log_printf( &logger, " 6DOF IMU 15 Click \r\n" );
log_printf( &logger, "---------------------- \r\n" );
}
else
{
log_printf( &logger, "---------------------- \r\n" );
log_printf( &logger, " FATAL ERROR!! \r\n" );
log_printf( &logger, "---------------------- \r\n" );
for ( ; ; );
}
c6dofimu15_default_cfg( &c6dofimu15 );
log_printf( &logger, " ---Initialised--- \r\n" );
log_printf( &logger, "---------------------- \r\n" );
Delay_ms ( 100 );
}
#define C6DOFIMU15_MAP_MIKROBUS(cfg, mikrobus)
Definition c6dofimu15.h:68
uint8_t c6dofimu15_who_im_i(c6dofimu15_t *ctx)
Who Am I function.
void application_init(void)
Definition main.c:33

Application Task

Measures acceleration and gyroscope data and displays the results on USB UART each second.

void application_task ( void )
{
float x_accel;
float y_accel;
float z_accel;
float x_gyro;
float y_gyro;
float z_gyro;
c6dofimu15_acceleration_rate( &c6dofimu15, &x_accel, &y_accel, &z_accel );
c6dofimu15_angular_rate( &c6dofimu15, &x_gyro, &y_gyro, &z_gyro );
log_printf( &logger, " Accel X: %.2f \t Gyro X: %.2f\r\n", x_accel, x_gyro );
log_printf( &logger, " Accel Y: %.2f \t Gyro Y: %.2f\r\n", y_accel, y_gyro );
log_printf( &logger, " Accel Z: %.2f \t Gyro Z: %.2f\r\n", z_accel, z_gyro );
log_printf( &logger, "----------------------------------\r\n");
Delay_ms ( 1000 );
}
void c6dofimu15_acceleration_rate(c6dofimu15_t *ctx, float *x_acel_rte, float *y_acel_rte, float *z_acel_rte)
Read Acceleration Rate function.
void c6dofimu15_angular_rate(c6dofimu15_t *ctx, float *x_ang_rte, float *y_ang_rte, float *z_ang_rte)
Read Angular Rate function.
void application_task(void)
Definition main.c:80

Application Output

This Click board can be interfaced and monitored in two ways:

  • Application Output - Use the "Application Output" window in Debug mode for real-time data monitoring. Set it up properly by following this tutorial.
  • UART Terminal - Monitor data via the UART Terminal using a USB to UART converter. For detailed instructions, check out this tutorial.

Additional Notes and Information

The complete application code and a ready-to-use project are available through the NECTO Studio Package Manager for direct installation in the NECTO Studio. The application code can also be found on the MIKROE GitHub account.